import { Pipe, PipeTransform } from '@angular/core';
import { RegisterFormData } from '../model/form.data';

@Pipe({
  name: 'account'
})
export class AccountPipe implements PipeTransform {

  transform(value: RegisterFormData): any {
    if (!value) {
      return '';
    } else if (value.type === 1) {
      return value.email;
    } else if (value.type === 2) {
      return value.regionNumber + '-' + value.phone;
    }
    // return never;
  }

}
